package com.xopencode.spring;

import com.xopencode.spring.config.SpringListenerConfig;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @Auther: Mcb
 * @Date: 2022/3/1 23:29
 * @Description: 事件发布及监听
 */
public class SpringListener {


    public static void main(String[] args) {
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(SpringListenerConfig.class);

        PublishService publishBean = applicationContext.getBean("publishService", PublishService.class);
        publishBean.publish();
    }
}
